/**
 * 工作流相关接口
 */

export const workflow = {
  addWorkflow: {
    post: "/api/idata/workflows"
  },
  deleteWorkflow: {
    delete: "/api/idata/workflows/{id}"
  },
  getWorkflowById: {
    get: "/api/idata/workflows/{id}"
  },
  updateWorkflow: {
    patch: "/api/idata/workflows/{id}"
  },
  renameWorkflow: {
    put: "/api/idata/workflows/{id}"
  },
  getWorkflowHistory: {
    get: "/api/idata/workflows/{id}/history"
  },
  runWorkflow: {
    post: "/api/idata/workflows/{id}/trigger"
  },
  stopWorkflow: {
    post: "/api/idata/workflows/kill"
  },
  getBackfillHistory: {
    get: "/api/idata/workflows/{id}/backfill"
  },
  runBackfill: {
    post: "/api/idata/workflows/{id}/backfill"
  },
  stopBackfill: {
    post: "/api/idata/backfill/{id}/kill"
  },
  getSchedulerList: {
    get: "/api/idata/workflows/scheduler_interval"
  },
  getCorn: {
    get: "/api/idata/workflows/cron?interval={interval}"
  },
  getProjectOptions: {
    get: "/api/idata/projects/options"
  },
  getWorkflowOptions: {
    get: "/api/idata/workflows/options?project_id={project_id}"
  },
  getReferenceTasks: {
    get: "/api/idata/tasks/options?project_id={project_id}&operator={operator}"
  },
  getWorkflowChildren: {
    get: "/api/idata/workflows/{id}/children"
  },
  getAlerts: {
    get: "/api/idata/workflows/{id}/alerts"
  },
  saveAlert: {
    post: "/api/idata/workflows/{id}/alerts"
  },
  retryFailed: {
    post: "/api/idata/workflows/retry_failed"
  }
};
